﻿<UserControl x:Class="LFSRecord2.View.TimelineLayerPropertyView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:lfsconv="clr-namespace:LFSRecord2.View.Converters" 
             xmlns:lfsvstruct="clr-namespace:LFSRecord2.View.TimelineStructures"
             mc:Ignorable="d" 
             d:DesignHeight="18" d:DesignWidth="150" 
             Width="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type StackPanel}}, Path=Width}" 
             Height="18"
             Loaded="TimelineLayerPropertyViewControl_Loaded">
    <UserControl.Resources>
        <lfsconv:IsAnimatedVisibilityConverter x:Key="isAnimatedVisibilityConverter" />
        <lfsconv:PropertyLabelSelectionBackgroundBrushConverter x:Key="propertyLabelSelectionBackgroundBrushConverter" />
        <lfsconv:LabelSelectionForegroundBrushConverter x:Key="labelSelectionForegroundBrushConverter" />
        <lfsconv:KWActiveImageConverter x:Key="kwActiveImageConverter" />
        <BitmapImage x:Key="KFClock" UriSource="pack://application:,,,/data/bitmaps/icons/KFClock.png" />
    </UserControl.Resources>
    <Grid Name="PropertyInfoGrid">
        <Rectangle Name="IsAnimatedImageBackGround" 
                   RadiusX="3" RadiusY="3" 
                   Width="15" Height="15" 
                   Stroke="#FFC0C0C0" Fill="#FF303030" 
                   HorizontalAlignment="Left" VerticalAlignment="Top" 
                   Margin="7,1,0,0" Visibility="{Binding IsAnimated, Converter={StaticResource isAnimatedVisibilityConverter}, Mode=OneWay}"
                   IsHitTestVisible="False" />
        <Image Source="{StaticResource KFClock}" Stretch="Fill" 
               Width="12" Height="12" 
               VerticalAlignment="Top" HorizontalAlignment="Left" 
               Margin="7,2,0,0"
               MouseLeftButtonDown="IsAnimatedImage_MouseLeftButtonDown"/>

        <Rectangle Name="LayerNameSelectionBackground" 
                   Width="61" Height="13" 
                   Margin="26,0,0,0" 
                   Fill="{Binding IsSelected, Converter={StaticResource propertyLabelSelectionBackgroundBrushConverter}}" 
                   HorizontalAlignment="Left"
                   MouseLeftButtonDown="Label_MouseLeftButtonDown" />
        <Label Margin="26,0,0,0" Padding="0,1,1,1" 
               Content="{Binding PropertyName}" 
               FontSize="11" Foreground="{Binding IsSelected, Converter={StaticResource labelSelectionForegroundBrushConverter}}" 
               HorizontalAlignment="Left"
               IsHitTestVisible="False" />
        
        <StackPanel Orientation="Horizontal" Name="PropertyValuesPanel" Margin="95,0,0,0" />

        <lfsvstruct:PropertyValueBindingControl x:Name="PropertyBindingControl" DataContext="{Binding}" HorizontalAlignment="Right" Margin="0,0,32,0" SnapsToDevicePixels="True" />
        
        <StackPanel Orientation="Horizontal" Name="KeyWalkerPanel" Margin="0,0,4,0" HorizontalAlignment="Right">
            <Image Name="KeyWalkerLeftImage" 
                   Source="{Binding HasPreFrames, Converter={StaticResource kwActiveImageConverter}, ConverterParameter=LeftArrow}" 
                   Stretch="None" Width="8" Height="11" 
                   MouseLeftButtonDown="KeyWalkerLeftImage_MouseLeftButtonDown" />
            <Image Name="KeyWalkerDotImage" 
                   Source="{Binding HasCurrentFrame, Converter={StaticResource kwActiveImageConverter}, ConverterParameter=CenterDot}" 
                   Stretch="None" Width="6" Height="11" 
                   MouseLeftButtonDown="KeyWalkerDotImage_MouseLeftButtonDown" />
            <Image Name="KeyWalkerRightImage" 
                   Source="{Binding HasPostFrames, Converter={StaticResource kwActiveImageConverter}, ConverterParameter=RightArrow}" 
                   Stretch="None" Width="8" Height="11"
                   MouseLeftButtonDown="KeyWalkerRightImage_MouseLeftButtonDown"/>
        </StackPanel>

        <Line X1="0" X2="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Path=Width}"
            Y1="18" Y2="18"
            Stroke="#FF606060"
            StrokeThickness="1"
            IsHitTestVisible="False" />
    </Grid>
</UserControl>
